﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration.Conventions;
using Domain.Model;

namespace Domain
{
    /// <summary>
    /// 数据库上下文    
    /// </summary>  
    public class RepositoryContext : DbContext
    {
        /// <summary>
        /// 约定生成
        /// </summary>
        /// <param name="modelBuilder"></param>
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // 移除表名复数约定
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
            base.OnModelCreating(modelBuilder);
        }
        /// <summary>
        /// 角色
        /// </summary>
        public DbSet<Role> Role { get; set; }
        /// <summary>
        /// 用户
        /// </summary>
        public DbSet<User> User { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public DbSet<Message> Message { get; set; }
        /// <summary>
        /// 通知
        /// </summary>
        public DbSet<Notity> Notity { get; set; }
        /// <summary>
        /// 推荐
        /// </summary>
        public DbSet<Recommend> Recommend { get; set; }
        /// <summary>
        /// 用户历史
        /// </summary>
        public DbSet<UserHistory> UserHistory { get; set; }
        /// <summary>
        /// 省份
        /// </summary>
        public DbSet<Province> Province { get; set; }
        /// <summary>
        /// 城市
        /// </summary>
        public DbSet<City> City { get; set; }
        /// <summary>
        /// 区域
        /// </summary>
        public DbSet<Area> Area { get; set; }
        /// <summary>
        /// 银行
        /// </summary>
        //public DbSet<Bank> Bank { get; set; }
        /// <summary>
        /// 用户-银行对应关系 
        /// </summary>
        public DbSet<UserBank> UserBank { get; set; }
        /// <summary>
        /// 系统日志
        /// </summary>
        public DbSet<SystemLog> SystemLog { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public DbSet<Sequence> Sequence { get; set; }
        /// <summary>
        /// 发布
        /// </summary>
        public DbSet<Publish> Publish { get; set; }
        /// <summary>
        /// 游戏豆
        /// </summary>
        public DbSet<GameRepertory> GameRepertory { get; set; }
        /// <summary>
        /// 会员分红
        /// </summary>
        public DbSet<MemberOutBonus> MemberOutBonus { get; set; }
        /// <summary>
        /// 分红
        /// </summary>
        public DbSet<Bonus> Bonus { get; set; }
        /// <summary>
        /// 分红明细
        /// </summary>
        public DbSet<BonusDetail> BonusDetail { get; set; }
        /// <summary>
        /// 新闻
        /// </summary>
        public DbSet<News> News { get; set; }
        /// <summary>
        /// 提现记录
        /// </summary>
        public DbSet<Withdraw> Withdraw { get; set; }
        /// <summary>
        /// 汇款记录
        /// </summary>
        public DbSet<Remittance> Remittance { get; set; }
        /// <summary>
        /// 支付
        /// </summary>
        public DbSet<Pay> Pay { get; set; }
        /// <summary>
        /// 转入
        /// </summary>
        public DbSet<Transfer> Transfer { get; set; }
        /// <summary>
        /// 游戏豆
        /// </summary>
        public DbSet<GameBean> GameBean { get; set; }
        public DbSet<FinanceCollect> FinanceCollect { get; set; }
        public DbSet<FinanceDetail> FinanceDetail { get; set; }
        public DbSet<FinanceBonusDetail> FinanceBonusDetail { get; set; }
        public DbSet<FinanceBonusReport> FinanceBonusReport { get; set; }
        public DbSet<FinanceAsideRate> FinanceAsideRate { get; set; }
        public DbSet<Guestbook> Guestbook { get; set; }
    }
}
